package com.yichat.micro.msghttpservice.component;

import com.github.benmanes.caffeine.cache.Cache;
import com.github.benmanes.caffeine.cache.Caffeine;
import org.springframework.cache.caffeine.CaffeineCache;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.concurrent.TimeUnit;

/**
 * Created by chenmohan on 2019/03/28
 *
 * @description 管理指定url的超时、重试次数、回调地址的配置规则Manager类
 */
@Component
public class HttpRequestRegularManager {

    private CaffeineCache regularCache;

    @PostConstruct
    public void init() {
        Cache<Object, Object> caffeineCache = Caffeine.newBuilder().expireAfterAccess(1, TimeUnit.HOURS).build();
        regularCache = new CaffeineCache("regularCache",caffeineCache);
    }


}
